/**
* 版权声明：厦门睿商网络科技有限公司 版权所有 违者必究
* 日    期：2020-12-15
*/
package com.rzico.article.service;

import com.rzico.article.model.BillFareAffiliatedVo;
import com.rzico.base.BaseMapper;
import com.rzico.base.impl.BaseServiceImpl;
import com.rzico.article.entity.BillFareAffiliated;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rzico.article.mapper.BillFareAffiliatedMapper;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <pre>
 * 名菜关联店铺业务类
 * </pre>
 *
 * @author Rzico Boot
 * @version 1.0
 */
@Service
public class BillFareAffiliatedService extends BaseServiceImpl<BillFareAffiliated, String> {

    @Autowired
    private BillFareAffiliatedMapper billFareAffiliatedMapper;

    @Override
    public BaseMapper<BillFareAffiliated, String> getMapper() {
        return billFareAffiliatedMapper;
    }

    public List<BillFareAffiliatedVo> selectBillFareList(Long billFareId, String shopName) {
        Map<String,Object> params = new HashMap<>();
        params.put("billFareId",billFareId);
        params.put("shopName",shopName);
        return billFareAffiliatedMapper.selectBillFareList(params);

    }

    public BillFareAffiliatedVo selectBillFare(Long billFareId, Long shopId) {
        Map<String,Object> params = new HashMap<>();
        params.put("billFareId",billFareId);
        params.put("shopId",shopId);
        List<BillFareAffiliatedVo> shopBillFareList = billFareAffiliatedMapper.selectBillFareList(params);
        if (shopBillFareList.size()>0) {
            return shopBillFareList.get(0);
        } else {
            return null;
        }

    }

}
